<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../css/bootstrap.min.css" />
<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>

<title>商品分类</title>
</head>
<body>
<div class="row" style="width:98%;margin-left: 1%;">
	<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
		<div class="panel panel-default">
			<div class="panel-heading">
				商品类型
			</div>
			<div class="panel-body">
				<div class="row">
					<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
						<div class="form-group form-inline">
							<span>商品等级</span>
							<input type="text" name="username" class="form-control">
						</div>
					</div>
					<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
						<div class="form-group form-inline">
							<span>商品名称</span>
							<input type="text" name="pubdate" class="form-control">
						</div>
					</div>
					<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
						<button type="button" class="btn btn-primary" id="search"><span class="glyphicon glyphicon-search"></span></button>
					</div>
				</div>
				<div style="height: 400px;overflow: scroll;">
				<table id="tb_list" class="table table-striped table-hover table-bordered">
					<tr>
						<td>序号</td><td>类型</td><td>等级</td><td>所属类型</td><td>操作</td>
					</tr>
					<%--goodsTypeList--%>
					<c:forEach items="${gtpageBean.data}" var="gtype" varStatus="i">
					<tr>
						<td>${i.count}</td>
						<td>${gtype.name}</td>
						<td>${gtype.level}</td>
						<td>${gtype.parent}</td>
						<td>
							<c:url var="updateurl" value="/getGoodsType?method=update">
								<c:param name="id" value="${gtype.id}"></c:param>
							</c:url>
							<a href="${updateurl}">更新</a>

							<c:url var="deleteurl" value="/getGoodsType?method=delete">
								<c:param name="id" value="${gtype.id}"></c:param>
							</c:url>
							<a onclick="return confirm('确定要删除吗?')" href="${deleteurl}">删除</a>
						</td>
					</tr>
					</c:forEach>
					<div style="width: 90%; margin: 0 auto;">
						<a href="getGoodsType?method=show&pageNum=1&pageSize=${gtpageBean.pageSize}">首页</a>
						<a href="getGoodsType?method=show&pageNum=${gtpageBean.pageNum-1}&pageSize=${gtpageBean.pageSize}">上一页</a>
						<c:forEach begin="${gtpageBean.startPage}" end="${gtpageBean.endPage}" var="num">
							<c:if test="${gtpageBean.pageNum==num}">
								<a class="active" href="getGoodsType?method=show&pageNum=${num}&pageSize=${gtpageBean.pageSize}">${num}</a>
							</c:if>
							<c:if test="${gtpageBean.pageNum!=num}">
								<a href="getGoodsType?method=show&pageNum=${num}&pageSize=${gtpageBean.pageSize}">${num}</a>
							</c:if>
						</c:forEach>
						<c:if test="${gtpageBean.pageNum!=gtpageBean.pageCount}">
							<a href="getGoodsType?method=show&pageNum=${gtpageBean.pageNum+1}&pageSize=${gtpageBean.pageSize}">下一页</a>
						</c:if>
						<%--<a href="${pageContext.request.contextPath}/booklistpage?pageNum=${pageBean.pageNum+1}&pageSize=${pageBean.pageSize}&title=${title}&author=${author}">下一页</a>--%>
						<a href="getGoodsType?method=show&pageNum=${gtpageBean.pageCount}&pageSize=${gtpageBean.pageSize}">末页</a>
						【共${gtpageBean.pageNum}/${gtpageBean.pageCount}页】
					</div>
				</table>
				</div>
			</div>
			
		</div>
	</div>
</div>
</body>
</html>